package com.wench.design.pattern.responsibility;

/**
 * @author wench
 */
public class ResponsibilityClient {
    public static void main(String[] args) {
        // 请假条来一张
        LeaveRequest leave = new LeaveRequest("小花", 5, "身体不适");

        // 各位领导
        GroupLeader groupLeader = new GroupLeader();
        Manager manager = new Manager();
        GeneralManager generalManager = new GeneralManager();

        // 小组长的领导是部门经理
        groupLeader.setNextHandler(manager);
        // 部门经理的领导是总经理
        manager.setNextHandler(generalManager);

        // 提交申请
        groupLeader.submit(leave);
    }
}